using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.Drawing;
using Dogfight2008.Common;
using OpenTK.Math;

namespace Dogfight2008.Common.Tests
{
  [TestFixture]
  public class ColoredTriangleFixture
  {
    [Test]
    public void Construct()
    {
      ConstructColoredTriangle();
    }

    public static ColoredTriangle ConstructColoredTriangle()
    {
      Triangle tri = TriangleFixture.ConstructTriangle();
      return new ColoredTriangle(Color.White, tri);
    }

    [Test]
    public void AccessTriangle()
    {
      Triangle tri = TriangleFixture.ConstructTriangle();
      ColoredTriangle ct = new ColoredTriangle(Color.White, tri);
      Assert.AreEqual(tri, ct.Triangle);
    }

    [Test]
    public void AccessColor()
    {
      ColoredTriangle ct = ConstructColoredTriangle();
      Assert.AreEqual(Color.White, ct.Color);
    }

    [Test]
    public void Equals()
    {
      ColoredTriangle ct1 = ConstructColoredTriangle();
      ColoredTriangle ct2 = ConstructColoredTriangle();
      Assert.AreEqual(ct1, ct2);
    }

    [Test]
    public void Equals2()
    {
      ColoredTriangle ct1 = new ColoredTriangle(Color.White, TriangleFixture.ConstructTriangle());
      ColoredTriangle ct2 = new ColoredTriangle(Color.Blue, TriangleFixture.ConstructTriangle());
      Assert.AreNotEqual(ct1, ct2);
    }

    [Test, ExpectedException("System.Exception")]
    public void NullTriangleNotOK() {
      ColoredTriangle tri = new ColoredTriangle(Color.Black, null);
    }
  }
}
